Php basic tutorial-2 create templates, process forms, basic tutorial forms
1. Create a template:
Copy the frequently-seen part of the page to an html or PHP file, and introduce it using the require ()/include () function in the original page.
Example:
Source html:
Copied header: header.html:
Copy tail: footer.html:
Merging template: ws. php
2. proces
, equivalent to whereTest.objects.filter (id=1)2. Get a single object, equivalent to whereTest.objects.get (id=1)3, sort, equivalent to the orderTest.objects.order_by ("id") can be chained using Test.objects.filter (name= "Runoob"). Order_by ("id")4. Get all data, equivalent to select * FROMList = Test.objects.all ()Change dataChange data using Save (), or update ()Delete dataCall Delete () toDjango Processing a form
HTML forms are an important
, equivalent to whereTest.objects.filter (id=1)2. Get a single object, equivalent to whereTest.objects.get (id=1)3, sort, equivalent to the orderTest.objects.order_by ("id") can be chained using Test.objects.filter (name= "Runoob"). Order_by ("id")4. Get all data, equivalent to select * FROMList = Test.objects.all ()Change dataChange data using Save (), or update ()Delete dataCall Delete () toDjango Processing a form
HTML forms are an important
: This article describes the PHP functions used to obtain comment templates and search forms in WordPress. For more information about PHP tutorials, see. Comments_template () (get Comment template)
The comments_template () function is used to obtain the comment template. it can only be used on articles or pages. it cannot be displayed if it is not an article or page.Usage
comments_template( $file, $separa
Explains the PHP functions used to get Comment templates and search forms in WordPress, wordpressphp
Comments_template () (Get comment template)
The Comments_template () function is used to get a comment template, which can only be used on articles or pages, if not articles or pages that cannot be displayed.Usage
Comments_template ($file, $separate _comments);
Parameters
$file
(string) (optional) to commen
One. Create a template:Copy the frequently occurring parts of the page into an HTML or PHP file, which is introduced in the original page with the Require ()/include () function.Example:SOURCE HTML:Copy of the head: header.html:Tail of copy: footer.html:Crafting Template: ws.phpSecond, processing the form-let a page simultaneously display and process the formTo use a conditional statement:if (Form submit) {process Form}else {Show Form}Example: Simple user name-password authenticationInput: User
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.